/*
 * FileDiff.java
 *
 * Copyright (c) 2008 Teamnet. All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of Teamnet.
 */

package ro.prj.manager.diff;


import ro.prj.manager.diff.model.JarsClassLoader;


import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.*;
import java.net.URL;
import java.net.MalformedURLException;

/**
 * This class is used to find all differences between 2 files
 */
public class FileDiff {
//    private static Log log=LogFactory.getLog(FileDiff.class);
    //constant defined for modified lines
    private static final String MODIFIED="modified";
    //constant defined for deleted lines
    private static final String DELETED="deleted";
    //constant defined for found lines
    private static final String FOUND="found";
    //constant defined for news lines
    private static final String NEW="new";
    //constant defined for lines number
    private static final String LINE_NO="line_no";

    /**
     * This method split a file into not null lines
     * @param filePath
     * @return
     */
    private static List<String> fileContents(String filePath){
        List<String> ret=new ArrayList<String>();
        File file=new File(filePath);
        try {
            Scanner scan=new Scanner(file);
            while(scan.hasNextLine()){
                String line=scan.nextLine();
                
                while(line.length()==0&&scan.hasNextLine())
                   line=scan.nextLine();
                ret.add(line);
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
           
        }


        return ret;
    }




    

    


}
